package cn.gson.crm.model.pojos;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;
import java.util.Objects;

@Entity
@Table(name = "Repair_order", schema = "CRM", catalog = "")
public class RepairOrder {
    private int repairId;
    private String repairNumber;
    private Timestamp repairTime;
    private Long repairMoney;
    private String repairState;
    private String repairBeizhu;
    private Customer customerByCustomerId;
    private Order orderByOrderId;
    private Employee employee;
    private List<RepairOrderDetails> repairOrderDetails;
    private Linkman linkman;
    private Long repaleZmoney;
    private String wexiufou;
    private String repalrLeibie;
    private String thdanhao;

    @Basic
    @Column(name = "REPALR_LEIBIE")
    public String getRepalrLeibie() {
        return repalrLeibie;
    }

    public void setRepalrLeibie(String repalrLeibie) {
        this.repalrLeibie = repalrLeibie;
    }

    @Basic
    @Column(name = "THDANHAO")
    public String getThdanhao() {
        return thdanhao;
    }

    public void setThdanhao(String thdanhao) {
        this.thdanhao = thdanhao;
    }

    @ManyToOne//可选属性optional=false,表示author不能为空。删除文章，不影响用户
    @JoinColumn(name = "LINK_ID")//设置在article表中的关联字段(外键)
    public Linkman getLinkman() {
        return linkman;
    }

    public void setLinkman(Linkman linkman) {
        this.linkman = linkman;
    }

    @OneToMany(mappedBy = "repairOrder")
    public List<RepairOrderDetails> getRepairOrderDetails() {
        return repairOrderDetails;
    }

    public void setRepairOrderDetails(List<RepairOrderDetails> repairOrderDetails) {
        this.repairOrderDetails = repairOrderDetails;
    }

    @ManyToOne//可选属性optional=false,表示author不能为空。删除文章，不影响用户
    @JoinColumn(name = "yg_id")//设置在article表中的关联字段(外键)
    public Employee getEmployee() {
        return employee;
    }

    public void setEmployee(Employee employee) {
        this.employee = employee;
    }
    @Id
    @Column(name = "repair_id")
    @GeneratedValue(generator = "seq",strategy = GenerationType.SEQUENCE)
    //定义一个序列生成器
    @SequenceGenerator(name = "seq",sequenceName = "crm",
            initialValue = 1,allocationSize = 1)
    public int getRepairId() {
        return repairId;
    }

    public void setRepairId(int repairId) {
        this.repairId = repairId;
    }

    @Basic
    @Column(name = "repair_number")
    public String getRepairNumber() {
        return repairNumber;
    }

    public void setRepairNumber(String repairNumber) {
        this.repairNumber = repairNumber;
    }
    @Basic
    @Column(name = "WEIXIUFOU")
    public String getWexiufou() {
        return wexiufou;
    }

    public void setWexiufou(String wexiufou) {
        this.wexiufou = wexiufou;
    }
    @Basic
    @Column(name = "repair_time")
    public Timestamp getRepairTime() {
        return repairTime;
    }

    public void setRepairTime(Timestamp repairTime) {
        this.repairTime = repairTime;
    }
    @Basic
    @Column(name="REPALR_ZMNEY")
    public Long getRepaleZmoney() {
        return repaleZmoney;
    }

    public void setRepaleZmoney(Long repaleZmoney) {
        this.repaleZmoney = repaleZmoney;
    }

    @Basic
    @Column(name = "repair_money")
    public Long getRepairMoney() {
        return repairMoney;
    }

    public void setRepairMoney(Long repairMoney) {
        this.repairMoney = repairMoney;
    }

    @Basic
    @Column(name = "repair_state")
    public String getRepairState() {
        return repairState;
    }

    public void setRepairState(String repairState) {
        this.repairState = repairState;
    }

    @Basic
    @Column(name = "repair_beizhu")
    public String getRepairBeizhu() {
        return repairBeizhu;
    }

    public void setRepairBeizhu(String repairBeizhu) {
        this.repairBeizhu = repairBeizhu;
    }



    @ManyToOne
    @JoinColumn(name = "customer_id", referencedColumnName = "customer_id")
    public Customer getCustomerByCustomerId() {
        return customerByCustomerId;
    }

    public void setCustomerByCustomerId(Customer customerByCustomerId) {
        this.customerByCustomerId = customerByCustomerId;
    }

    @ManyToOne
    @JoinColumn(name = "order_id", referencedColumnName = "order_id")
    public Order getOrderByOrderId() {
        return orderByOrderId;
    }

    public void setOrderByOrderId(Order orderByOrderId) {
        this.orderByOrderId = orderByOrderId;
    }
}
